buildscript {
    repositories {
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.0'
    }
}

apply plugin: 'com.android.application'

def layersDir = "../../../build-android/libs"

android {
    compileSdkVersion = 25
    buildToolsVersion = "25.0.2"

    defaultConfig {
        applicationId = "com.example.Smoke"
        minSdkVersion 24
        targetSdkVersion 24
        versionCode = 1
        versionName = "0.1"
        ndk.abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86'
        externalNativeBuild {
            cmake.arguments '-DANDROID_PLATFORM=android-24',
                            '-DANDROID_STL=c++_static',
                            '-DANDROID_TOOLCHAIN=clang'
        }
    }
    externalNativeBuild {
        cmake.path 'CMakeLists.txt'
    }

    // Need Android NDK-r12+ for pre-built validation layers
    sourceSets {
        main.jniLibs.srcDirs = [ "${layersDir}" ]
    }

    buildTypes {
        release {
            // enable debugging for release built too
            ndk {
                debuggable = true
            }
            minifyEnabled = false
            proguardFiles getDefaultProguardFile('proguard-android.txt'),
                'proguard-rules.pro'
        }
    }
}
